<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>日期</title>
	<script type="text/javascript">
		
		// 时间戳 :指的是从1970 01 01  0 0 0 到现在秒数

		yuandan = new Date('2018-01-01 0:0:0');
		
		// document.write(Math.ceil(yuandan.getTime()/1000));

		// document.write("<br>");


		now = new Date();

		// document.write(Math.ceil(now.getTime()/1000));

		// document.write("<br>");

		wuyi = new Date("2018-05-01 0:0:0");

		// document.write(Math.ceil(wuyi.getTime()/1000));

		// document.write("<br>");


		diff = Math.ceil(wuyi.getTime()/1000) -Math.ceil(now.getTime()/1000);

		// document.write(diff/86400);




		// date = "2018-3-9"-"2017-8-9";



		// var date = new Date('1997-10-04');

		// alert(date.getDay());

		cn = 0;

		for (var i = 1997; i < 2018; i++) {
			
			date = i+"-10-04";

			dateObj = new Date(date);

			if(dateObj.getDay()==6 || dateObj.getDay()==0){
				cn++;
			}
		}
		document.write(cn);


		now = new Date();

		before = Math.ceil((now.getTime()-100*86400*1000));

		// alert(before);


		date = new Date(before);

		alert(date.getFullYear())
		alert(date.getMonth())
		alert(date.getDate())


		计算5-1离现在还有多天多少小时多少分钟多少秒


		今年的200天 周几


	</script>
</head>
<body>
	
</body>
</html>